package string;

import java.util.Scanner;

public class EmailDemo {
    /**
     * 用户名@服务器地址
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个邮箱：");
        String email= scanner.nextLine();
        //截取?的字符串方法
        int a = email.indexOf("@");
        int b = email.indexOf("@")+1;
        String name = email.substring(0,a);
        String name2 = email.substring(b,email.length());
        System.out.println(name);
        System.out.println(name2);


    }
}
